﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {


            emplList empl1 = new emplList();
            empl1.firstName = "Valeriy";
            empl1.lastName = "Malinovskiy";
            empl1.salary = 1000;

            emplList empl2 = new emplList();
            empl2.firstName = "Denis";
            empl2.lastName = "Udachin";
            empl2.salary = 1000;

            emplList empl3 = new emplList();
            empl3.firstName = "Anton";
            empl3.lastName = "Isaev";
            empl3.salary = 1000;

            emplList empl4 = new emplList();
            empl4.firstName = "Anton";
            empl4.lastName = "Petrenko";
            empl4.salary = 1000;

            emplList empl5 = new emplList();
            empl5.firstName = "Yurii";
            empl5.lastName = "Gura";
            empl5.salary = 1000;

            emplList[] personArray = new emplList[5];
            personArray[0] = empl1;
            personArray[1] = empl2;
            personArray[2] = empl3;
            personArray[3] = empl4;
            personArray[4] = empl5;

            int sumSalary = 0;
            foreach (var emplList in personArray)
            {
                emplList.printInfo();
                sumSalary += emplList.salary;
            }
            Console.WriteLine(sumSalary);
        }

    }

}
